package com.bustle.ejb.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;

@Entity
public class User
{
  public int getId()
  {
    return id;
  }

  public void setId(int anId)
  {
    id = anId;
  }

  public Date getBirthday()
  {
    return birthday;
  }

  public void setBirthday(Date aBirthday)
  {
    birthday = aBirthday;
  }

  public String getEmail()
  {
    return email;
  }

  public void setEmail(String anEmail)
  {
    email = anEmail;
  }

  public String getFirstName()
  {
    return firstName;
  }

  public void setFirstName(String aFirstName)
  {
    firstName = aFirstName;
  }

  public String getLastName()
  {
    return lastName;
  }

  public void setLastName(String aLastName)
  {
    lastName = aLastName;
  }

  public Address getAddress()
  {
    return address;
  }

  public void setAddress(Address anAddress)
  {
    address = anAddress;
  }

  public Type getType()
  {
    return type;
  }

  public void setType(Type aType)
  {
    type = aType;
  }

  @Override
  public String toString()
  {
    return firstName + " " + lastName;
  }

  @Id
  @GeneratedValue
  private int id;
  private Date birthday;
  private String email;
  private String firstName;
  private String lastName;
  @OneToOne
  private Address address;
  private Type type;

  public enum Type
  {
    ADMINISTRATOR,
    CUSTOMER
  }
}